//
//  YLAMYVIPCell.swift
//  Your Lover AI
//
//  Created by 阿忠 on 2024/6/22.
//

import Foundation
import UIKit

class YLAMYVIPCell: UITableViewCell {
    
    //背景
    lazy var backVc: UIView = {
        let view = UIView()
        view.backgroundColor = .clear
        view.layer.cornerRadius = 10.0 // 设置圆角半径为10.0
        view.layer.masksToBounds = true
        return view
    }()
    
    //背景图
    lazy var backImg: UIImageView = {
        let image = UIImageView(image: UIImage(named: "me_store_bg"))
        image.layer.cornerRadius = 15
        return image
    }()
    
    //vip图
    lazy var vipImg: UIImageView = {
        let image = UIImageView(image: UIImage(named: "me_store_icon"))
        return image
    }()
    
    //跳转图
    lazy var rightImg: UIImageView = {
        let image = UIImageView(image: UIImage(named: "me_store_right"))
        return image
    }()
    
    //名字
    lazy var nameLab: UILabel = {
        let lab = UILabel()
        lab.text = "Stort"
        lab.textColor = UIColor(hex: "8B4C07")
        lab.font = UIFont.systemFont(ofSize: 18)
        lab.textAlignment = .left
        lab.numberOfLines = 0
        return lab
    }()
    
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        contentView.backgroundColor = .clear
        contentView.addSubview(backVc)
        backVc.addSubview(backImg)
        backVc.addSubview(nameLab)
        backVc.addSubview(vipImg)
        backVc.addSubview(rightImg)
        initUI()
    }

    
    func initUI()
    {
        backVc.snp.makeConstraints { make in
            make.left.equalTo(0)
            make.right.equalTo(0)
            make.top.equalTo(0)
            make.bottom.equalTo(0)
        }
        
        backImg.snp.makeConstraints { make in
            make.left.equalTo(16)
            make.right.equalTo(-16)
            make.bottom.equalToSuperview()
            make.height.equalTo(66)
        }
        
        vipImg.snp.makeConstraints { make in
            make.left.equalTo(backImg).offset(14)
            make.centerY.equalTo(backImg)
            make.width.height.equalTo(47)
        }
        
        nameLab.snp.makeConstraints { make in
            make.left.equalTo(vipImg.snp.right).offset(10)
            make.centerY.equalTo(backImg)
        }
        
        rightImg.snp.makeConstraints { make in
            make.right.equalTo(-18-16)
            make.centerY.equalTo(backImg)
        }
        
    }
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
